<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>核销表单</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .container {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            width: 90%;
            max-width: 400px;
        }
        h1 {
            text-align: center;
            color: #333;
        }
        form {
            display: flex;
            flex-direction: column;
        }
        label {
            margin-bottom: 5px;
            color: #555;
        }
        input[type="text"],
        input[type="password"] {
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 16px;
        }
        button {
            padding: 10px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        button:hover {
            background-color: #0056b3;
        }
        .message {
            margin-top: 15px;
            text-align: center;
            color: #ff0000;
        }
        .verified-message {
            margin-top: 15px;
            text-align: center;
            color: #333;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>核销表单</h1>

    <!-- 检查是否已经核销过 -->
    <div th:if="${isVerified}">
        <div class="verified-message">
            <p>该表单已经核销过。</p>
            <p th:text="'核销时间: ' + ${verificationTime}"></p>
        </div>
    </div>

    <div th:unless="${isVerified}">
        <form th:action="@{/verify}" method="post">
            <input type="hidden" id="phoneNumber" name="phoneNumber" th:value="${formData.phoneNumber}" required>

            <label for="password">密码:</label>
            <input type="password" id="password" name="password" required><br><br>

            <button type="submit">核销</button>
        </form>
    </div>

    <div th:if="${message}" class="message">
        <p th:text="${message}"></p>
    </div>
</div>
</body>
</html>
